$T_{ein}=493,15K$
p=50 bar
Stoffbilanzen
$\dot n_i = \dot n_{i, 0} + \sum_{j}{\nu_ij \xi_j}$
Energiebilanz
$\begin{array}{ll} 0 &= \dot Q + (\dot n (\Delta H^\circ_{(T)}-\Delta H^\circ_0))_{ein}- (\dot n (\Delta H^\circ_{(T)}-\Delta H^\circ_0))_{aus} + \sum\limits_{j}{\xi_j (-\Delta Hr_j(T))}\\ &= 0 + (\dot n (\Delta H^\circ_{(T)}-\Delta H^\circ_0))_{ein}- (\dot n (\Delta H^\circ_{(T)}-\Delta H^\circ_0))_{aus} + \sum\limits_{j}{\xi_j (-\Delta Hr_j(T))}\\ \end{array}\\ $
$\begin{array}{ll} exp \left(- \frac{\Delta G_i}{R T} \right) &= K_p K_{\phi^{eq}} = K_x \prod\limits_{i} \left( \frac{p}{p^0}\right)^{\nu_i} K_{\phi^{eq}} \\ &=\prod\limits_{i} (n_i)^{\nu_i}\left( \frac{p}{p^0}\right)^{\sum\limits_{i} \nu_i}(n)^{-\sum\limits_{i} \nu_i} K_{\phi^{eq}}\end{array}$
$p^0 = 1 bar$
Idealer Gas, $K_{\phi^{eq}}=1$
Methode A) Geringe Veränderung der Reaktionsenthalpie mit der Temperatur
Van't Hoff, $\frac{d ln K}{dT} = -\frac{\Delta H}{R T^2} \sim \Rightarrow ln \left(\frac{K}{K'} \right) = -\frac{\Delta H^0}{R}\left(\frac{1}{T} - \frac{1}{T'} \right)$
$\begin{array}{ll} K_{(493,15K)} &= K_{(298,15K)} \times exp \left[-\frac{\Delta H^0}{R}\left(\frac{1}{493,15 K} - \frac{1}{298,15 K} \right)\right] \\ &= \prod_i (n_i)^{\nu_i}\left( \frac{p}{p^0}\right)^{\sum_i \nu_i}(n)^{-\sum_i \nu_i}\end{array}$
Methode B) Wechselwirkung der Reaktionsenthalpie mit der Temperatur [SVNA]
$\Delta H^\circ = \Delta H_0^\circ + R \int\limits_{T_0}^{T}{\frac{\Delta Cp^\circ}{R}dT}$
$\Delta S^\circ = \Delta S_0^\circ + R \int\limits_{T_0}^{T}{\frac{\Delta Cp^\circ}{R}\frac{dT}{T}}$
$\Delta G^\circ = \Delta H^\circ - T \Delta S^\circ = \Delta H_0^\circ + R \int\limits_{T_0}^{T}{\frac{\Delta Cp^\circ}{R}dT} - T \Delta S_0^\circ - R T \int\limits_{T_0}^{T}{\frac{\Delta Cp^\circ}{R}\frac{dT}{T}}$
$\Delta S_0^\circ = \frac{\Delta H_0^\circ - \Delta G_0^\circ}{T_0}$
$\Delta G^\circ = \Delta H_0^\circ - \frac{T}{T_0}(\Delta H_0^\circ -\Delta G_0^\circ) + R \int\limits_{T_0}^{T}{\frac{\Delta Cp^\circ}{R}dT} - R T \int\limits_{T_0}^{T}{\frac{\Delta Cp^\circ}{R}\frac{dT}{T}}$
$\begin{array}{ll} K_{(T)} &= exp \left(-\frac{\Delta H_0^\circ}{R T} + \frac{(\Delta H_0^\circ -\Delta G_0^\circ)}{R T_0} - \frac{1}{T}\int\limits_{T_0}^{T}{\frac{\Delta Cp^\circ}{R}dT} + \int\limits_{T_0}^{T}{\frac{\Delta Cp^\circ}{R}\frac{dT}{T}}\right) \\ &= \prod_i (n_i)^{\nu_i}\left( \frac{p}{p^0}\right)^{\sum_i \nu_i}(n)^{-\sum_i \nu_i}\end{array}$
Somit läßt sich K(T) bestimmen, insofern man über einen Ausdruck für $Cp_i(T)$ verfügt. Bei geringer Veränderung der Wärmekapazität Cp im Temperatur-Bereich kann man auch einen bestimmten Mittelwert als ~konstant einsetzen.
Methode C) Gibbs'sche Energie-Funktion - Gef(T) - aus Thermochemischen Tabellen [BP]
$-Gef(T) = -[G(T)-H(298,15)]/T$
$-R ln(K) = \sum\nu_i Gef_i - \sum \nu_i H_i(298,15K)/T$
In thermochemischen Tabellen [BP] sind die Werte -Gef(T) verfügbar.
In [1]:
from scipy import optimize
import numpy as np
p = 50. # bar
temp = 273.15 + 220. # K
t0_ref = 298.15 # K
r = 8.314 # J/(mol K)
namen = ['CO', 'H2', 'CO2', 'H2O', 'CH3OH']
n0co = 50.
n0h2 = 100.
n0co2 = 0.
n0h2o = 0.
n0ch3oh = 0.
ne = np.array([n0co, n0h2, n0co2, n0h2o, n0ch3oh])
nuij = np.array([[-1, -2, 0, 0, +1] ,
[0, -3, -1, +1, +1],
[-1, +1, +1, -1, 0]]).T
h_298 = np.array(
[-110.541, 0., -393.505, -241.826,-201.167]) * 1000 # J/mol
g_298 = np.array(
[-169.474, -38.962, -457.240, -298.164, -272.667]) * 1000 # J/mol
# Berechne delta Cp(T) mit Temperaturfunktionen für ideale Gase (SVN).
# Koeffizienten für Cp(T)/R = A + B*T + C*T^2 + D*T^-2, T[=]K
# Nach rechts hin: A, B, C, D
# Nach unten hin: CO, H2, CO2, H2O, CH3OH
cp_coefs = np.array([
[
y.replace(',', '.') for y in x.split('\t')
] for x in """
3,3760E+00 5,5700E-04 0,0000E+00 -3,1000E+03
3,2490E+00 4,2200E-04 0,0000E+00 8,3000E+03
5,4570E+00 1,0450E-03 0,0000E+00 -1,1570E+05
3,4700E+00 1,4500E-03 0,0000E+00 1,2100E+04
2,2110E+00 1,2216E-02 -3,4500E-06 0,0000E+00
""".split('\n') if len(x)>0], dtype=float)
def cp(t):
return r * (
cp_coefs[:,0] +
cp_coefs[:,1] * t +
cp_coefs[:,2] * t**2 +
cp_coefs[:,3] * t**-2
) # J/(mol K)
# Berechne H(T), G(T) und K(T) mit Cp(T)
def h(t):
return (
h_298 +
r * cp_coefs[:,0]*(t-t0_ref) +
r * cp_coefs[:,1]/2.*(t**2-t0_ref**2) +
r * cp_coefs[:,2]/3.*(t**3-t0_ref**3) -
r * cp_coefs[:,3]*(1/t-1/t0_ref)
) # J/mol
def g(t, h_t):
return (
h_t - t/t0_ref*(h_298 - g_298) -
r * cp_coefs[:,0]*t*np.log(t/t0_ref) -
r * cp_coefs[:,1]*t**2*(1-t0_ref/t) -
r * cp_coefs[:,2]/2.*t**3*(1-(t0_ref/t)**2) +
r * cp_coefs[:,3]/2.*1/t*(1-(t/t0_ref)**2)
) # J/mol
def k(t, g_t):
delta_g_t = nuij.T.dot(g_t)
return np.exp(-delta_g_t/(r * t))
delta_gr_298 = nuij.T.dot(g_298)
delta_hr_298 = nuij.T.dot(h_298)
cp_493 = cp(493.15) # J/(mol K)
h_493 = h(493.15) # J/mol
g_493 = g(493.15, h_493) # J/mol
k_493 = k(493.15, g_493) # []
for i, f in enumerate(delta_hr_298):
print('Delta H_' + str(i+1) + '(298.15K)=' + str(f/1000.) + 'kJ/mol')
print('\n')
for i, f in enumerate(k_493):
print('K' + str(i+1) + '(493K)=' + str(f))
print('\n')
n0 = np.array([n0co, n0h2, n0ch3oh])
def fun(x_vec):
nco = x_vec[0]
nh2 = x_vec[1]
nch3oh = x_vec[2]
xi1 = x_vec[3]
t = x_vec[4]
n = np.array([nco, nh2, nch3oh])
cp_t = cp(t)
h_t = h(t)
g_t = g(t, h_t)
k_t = k(t, g_t)
h_ein = h_493[[1, 2, -1]]
cp_ein = cp_493[[1, 2, -1]]
cp_t = cp_t[[1, 2, -1]]
h_t = h_t[[1, 2, -1]]
g_t = g_t[[1, 2, -1]]
delta_h_t = nuij[[1, 2, -1]].T.dot(h_t) # J/mol
f1 = -nco + n0co - xi1
f2 = -nh2 + n0h2 -2*xi1
f3 = -nch3oh + n0ch3oh +xi1
f4 = -k_t[0] * (nco * nh2**2) + \
nch3oh * (p/1.)**-2 * (nco + nh2 + nch3oh)**-(-2)
#f5 = np.sum(
# np.multiply(n0, h_ein) -
# np.multiply(n, h_t)
#) + xi1 * (-delta_h_t[0])
f5 = np.sum(
np.multiply(n0, cp_ein)*493.15 -
np.multiply(n, cp_t)*t
) + xi1 * (-delta_h_t[0])
return [f1, f2, f3, f4, f5]
x0 = np.append(n0, [0., 493.15])
sol = optimize.root(fun, x0)
f_final = - sol.x[:3].reshape([3,1]) + ne[[0,1,4]].reshape([3,1]) + nuij[:,0][[0,1,4]].reshape([3,1])*sol.x[-2]
print(sol)
print('\n\n')
print('Zustand der Optimisierungs-Funktionen\n')
print(f_final)
print('\n\n')
print('T_ein=493.15K, p=50 bar, in adiabatischem Reaktor')
print('Lösung für nur einzige Reaktion (ohne CO2):\n')
for i, f in enumerate(sol.x[:2]):
print('n_' + namen[i] + '= ' + str(f) + ' mol')
print('n_' + namen[-1] + '= ' + str(sol.x[2]) + ' mol')
print('T= ' + str(sol.x[-1]) + ' K')
n0 = np.array([n0co, n0h2, n0co2, n0h2o, n0ch3oh])
n0 = ne
# Lösung des einfacheren Falls in schwierigerem Fall einwenden.
def fun(x_vec):
nco = x_vec[0]
nh2 = x_vec[1]
nco2 = x_vec[2]
nh2o = x_vec[3]
nch3oh = x_vec[4]
xi1 = x_vec[5]
xi2 = x_vec[6]
xi3 = x_vec[7]
t = x_vec[8]
n = np.array([nco, nh2, nco2, nh2o, nch3oh])
xi = np.array([xi1, xi2, xi3])
h_ein = h_493
cp_ein = cp_493
cp_t = cp(t)
h_t = h(t)
g_t = g(t, h_t)
k_t = k(t, g_t)
delta_h_t = nuij.T.dot(h_t) # J/mol
f1 = -nco + n0co - xi1 +0 -xi3
f2 = -nh2 + n0h2 -2*xi1 -3*xi2 +xi3
f3 = -nco2 + n0co2 +0 -xi2 +xi3
f4 = -nh2o + n0h2o +0 +xi2 -xi3
f5 = -nch3oh + n0ch3oh +xi1 +xi2 -0
f6 = -k_t[0] * (nco * nh2**2) + \
nch3oh * (p/1.)**-2 * (nco + nh2 + nco2 + nh2o + nch3oh)**-(-2)
f7 = -k_t[1] * (nco2 * nh2**3) + \
nch3oh * nh2o * (p/1.)**-2 * (nco + nh2 + nco2 + nh2o + nch3oh)**-(-2)
f8 = -k_t[2] * (nco * nh2o) + \
nco2 * nh2 * (p/1.)**0 * (nco + nh2 + nco2 + nh2o + nch3oh)**-0
f9 = np.sum(
np.multiply(n0, (h_ein-h_298)) -
np.multiply(n, (h_t-h_298))) + np.dot(xi, -delta_h_t)
#f9 = np.sum(
# np.multiply(n0, cp_ein)*493.15 -
# np.multiply(n, cp_t)*t) + np.dot(xi, -delta_h_t)
return [f1, f2, f3, f4, f5, f6, f7, f8, f9]
x0 = np.append(n0, [0., 0., 0., sol.x[-1]])
sol = optimize.root(fun, x0)
f_final = - sol.x[:5].reshape([5,1]) + ne.reshape([5,1]) + nuij.dot(sol.x[5:-1].reshape([3,1]))
print('\n\n')
print('T_ein=493.15K, p=50 bar, in adiabatischem Reaktor.')
print('Lösung für alle drei Reaktionen, mit CO2:\n')
for i, f in enumerate(sol.x[:5]):
print('n_' + namen[i] + '= ' + str(f) + ' mol')
print('\n')
for i, f in enumerate(sol.x[5:-1]):
print('xi_' + str(i) + '= ' + str(f) + ' mol')
print('\n')
print('T=' + str(sol.x[-1]) + ' K, oder...')
print('T=' + str(sol.x[-1]-273.15) + ' °C')
print('\n')
print('0 = Q + Sum(Delta H)_ein - Sum(Delta H)_aus')
bilanz = np.sum(
np.multiply(n0, (h_493-h_298)) -
np.multiply(sol.x[:5], (h(sol.x[-1])-h_298))
) + np.dot(sol.x[5:-1], -nuij.T.dot(h(sol.x[-1])))
annaeherung = np.sum(
np.multiply(n0, cp_493)*493.15 -
np.multiply(sol.x[:5], cp(sol.x[-1]))*sol.x[-1]
) + np.dot(sol.x[5:-1], -nuij.T.dot(h(sol.x[-1])))
print('-Q = (n.(H_t-H_298))_ein -(n.(H_t-H_298))_aus + Sum(xi_j * (-Delta Hr_j)) = ' +
str(bilanz) + 'J/h')
print('-Q = (n Cp T)_ein - (n Cp T)_aus + Sum(xi_j * (-Delta H_j)) = ' +
str(annaeherung) + 'J/h' +
'(nur Annäherung. Fehler: ' + '{:.2f}'.format(
(annaeherung-bilanz)/bilanz) + ')' )
print('\n\n')
print('Zustand der Optimisierungs-Funktionen\n')
print(f_final)
In [3]:
print('Lösung, in 30 Dezimalzahlen')
print('')
for part in sol.x:
print('{:.30g}'.format(part).replace('.',','))